<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/page/public/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>公共库</title>
<% request.setAttribute("menu", 1); %>
<%@ include file="/WEB-INF/page/public/contentmeta.jsp"%>
<script type="text/javascript" src="<%=basePath%>js/insert.js"></script>
<link rel="stylesheet" href="<%=basePath%>css/global.css" media="all" />
<link rel="stylesheet" href="<%=basePath%>plugins/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="<%=basePath%>css/tab.css" media="all" />



</head>
<body>

	<input type="hidden" id="successlog" value="${successlog}">
	 
	<div class="admin-tab TM-tab">
		<div class="layui-tab layui-tab-card">
			<%@ include file="/WEB-INF/page/customermanage/customerlistmenu.jsp" %>
			<div class="layui-tab-content">
				<div class="layui-tab-item layui-show">
					<div class="tab-condition ">
					
						<%@ include file="/WEB-INF/page/customermanage/customerlistform.jsp"%>
						
						<div class="TM-tab-info">
							<a class="layui-btn layui-btn-primary layui-btn-small  insertbtn" typedata="${customertype}" statedata="${customerstate}"><i class="layui-icon">&#xe62f;</i>导入资源</a>
							<a class="layui-btn layui-btn-primary layui-btn-small  hdcxbtn"><i class="layui-icon">&#xe615;</i>检索录入</a>
							<a class="layui-btn layui-btn-primary layui-btn-small plhqbtn"><i class="layui-icon">&#xe654;</i>批量获取</a>
							<a class="layui-btn layui-btn-primary layui-btn-small  refreshbtn"><i class="layui-icon">&#x1002;</i>刷新</a>
							<!-- <a class="layui-btn layui-btn-primary layui-btn-small lrxxbtn">+录入信息</a> -->
							<!-- <a class="layui-btn layui-btn-primary layui-btn-small active hqbtn">+获取</a> -->
						</div>
					</div>
					<div class="layui-field-box">
						<table class="site-table table-hover TM-table3">
							<thead>
							<tr>
							<th style="width:5%;"><input type="checkbox" id="selected-all" name="customcheck"/></th>
								 
								<th style="width:25%;">企业名称</th>
								<th style="width:10%;">企业资质</th>
								<th style="width:10%;">所在地区</th>
								<th style="width:10%;">联系人 </th>
								<th style="width:15%;">联系方式</th>
								<th style="width:10%;">最后跟进时间</th>
								<th style="width:15%;">操作</th>
							</tr>
							</thead>
							<tbody>
							<c:set var="vEnter" value="\n" scope="request"/>
							<% request.setAttribute("vEnter", "\n"); %> 
							<c:forEach var="obj" items="${pager.resultList}" varStatus="o1">
								<tr cname="${obj.cname}">
									<td><input type="checkbox" name="customcheckbox" value="${obj.id}" data="${obj.dystate}"  dname="${obj.cname}" /></td>
									<td>
											<dic:str value="${obj.cname}"  maxLength="20"/>
									</td>
									<td class="TM_hover seecategory seecategory${obj.id}" catevalue='<c:if test="${fn:length(obj.zzleval) > 0 }"><c:out value="${fn:replace(obj.zzleval, vEnter, '<br />')}" /></c:if>' data="${obj.id}">
										<!-- 有一个显示一个，有多个显示一个并加...，没有就显示暂无资质信息 -->
										<c:if test="${fn:length(obj.zzleval)<1}">
											暂无资质情况
										</c:if>
										<c:if test="${fn:length(obj.zzleval)>1}">
											<dic:str value="${obj.zzleval}"  maxLength="6"/> 
										</c:if>
									</td>
									<td><dic:str value="${obj.address}"  maxLength="6"/> </td>
									<td  id="dhlxr"><c:set property="mainuser" value="0" var="mainuser"></c:set><c:set property="mainusername" value="" var="mainusername"></c:set><c:if test="${fn:length(obj.contactsItem)> 0}"><c:set property="mainusername" value="${obj.contactsItem.get(0).name }" var="mainusername"></c:set><c:forEach  items="${obj.contactsItem}" var="csObj"><c:if test="${csObj.ismain==1}">${csObj.name}<c:set property="mainuser" value="1" var="mainuser"></c:set></c:if></c:forEach></c:if><c:if test="${mainuser==0}">${mainusername}</c:if></td>
									<td>
										<c:set property="mainuser" value="0" var="mainuser"></c:set>
										<c:if test="${fn:length(obj.contactsItem)> 0}">
											<c:forEach  items="${obj.contactsItem}" var="csObj">
											      <c:if test="${csObj.ismain==1}"><dic:phone value="${csObj.phone}"/><c:set property="mainuser" value="1" var="mainuser"></c:set></c:if>
											</c:forEach>
											<c:if test="${mainuser==0}"><dic:phone value="${obj.contactsItem.get(0).phone}"/></c:if>
										</c:if>
										
									</td>
									<td class="TM_hover seenote seenote${obj.id}" data="${obj.id}">${obj.updatedate.substring(0,10)}</td>
									<td>
										<button type="button" class="layui-btn layui-btn-normal layui-btn-mini showinfo" data="${obj.id}">查看</button>
										<button type="button"  class="layui-btn layui-btn-normal layui-btn-mini hqbtn" data="${obj.id}">获取</button>
										<button type="button"  class="layui-btn layui-btn-normal layui-btn-mini lxjlbtn " data="${obj.id}">跟进</button>
										<button type="button"   class="layui-btn layui-btn-normal layui-btn-mini hszbtn " data="${obj.id}">回收</button>
									</td>
								</tr>	
							</c:forEach>
							</tbody>
						</table>
						<div class="admin-table-page">
            				<div id="page" class="page"></div>
        				</div>
					</div>
				</div>
			</div>
		</div>
		
		<!-- 资源导入弹窗 -->
		<div id="insertdiv" style="display:none;">
			<form id="insertform" action="/systerm/uploadexcel" method="post" enctype="multipart/form-data">
				<div style="margin-top: 20px;font-size: 18px; text-align: center;">
					<div>
						<blockquote class="layui-elem-quote"><a href="<%=basePath%>upload/enterprise.xlsx"><b>点击下载</b></a>模版，填写完成后点击上传。</blockquote>
					</div>
					<div style="margin-top: 10px;">
						<input type="file" id="file" name="file" style="border: 1px solid #e6e6e6;height: 31px;">
						<input type="hidden" id="filetype" name="type" value="${customertype}">
						<input type="hidden" id="filestate" name="state" value="${customerstate}">
					</div>	
				</div>
			</form>
		</div>
		
		
		
	</div>
	<script type="text/javascript" src="<%=basePath%>js/customerlist.js?v=<%=callcenterstate%>15"></script>
	
	
</body>
</html>